﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class LJB_Test : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MysqlHelp test = new MysqlHelp();
        string sql = "select * from filetype where filetype = '文本'";
        DataTable table = test.GetDatabysql(sql);
        int typeCount = table.Rows.Count;
        string msql = "";
        for (int j = 0; j < typeCount; j++)
        {
            if (msql == "")
            {
                msql = "(" + table.Rows[j]["id"].ToString();
            }
            else msql += "," + table.Rows[j]["id"].ToString();           
        }
        msql += ")";

        sql = "select * from resource where filetype in "+msql+" ORDER BY updatatime DESC";
        table = test.GetDatabysql(sql);
        typeCount = table.Rows.Count;
        Response.Write(sql+"<BR>");
        for (int i = 0; i< typeCount; i++)
        {
            Response.Write(table.Rows[i]["filetype"].ToString()+"<BR>");
        }

        
    }
}
